<template>
  <div>
    <img :src="imgSrc" :alt="date" style="width:100%" />
  </div>
</template>

<script>
import { Toast } from "vant";
export default {
  name: "saveImg",
  data() {
    return {
      date: Date.parse(new Date()),
      imgSrc: ""
    };
  },
  created() {
    if (this.$route.params.imgSrc) {
      localStorage.setItem("imgSrc", this.$route.params.imgSrc);
    }
    this.imgSrc = this.$route.params.imgSrc || location.getItem("imgSrc");
    Toast("长按或者另存为图片，可以保存到本地");
  }
};
</script>

<style lang="scss" scoped>
</style>
